package com.shun.common.utils;

import org.modelmapper.ModelMapper;

/**
 * 通用工具类
 * @author clever
 * @since 2021-09-27
 */
public class ShunCommonUtils {

    /**
     * bean对象转化另一种bean
     * @param dto
     * @param clz
     * @param <T>
     * @return
     */
    public static <T> T beanMap(Object dto ,Class<T> clz){
         if(null != dto){
             ModelMapper modelMapper = new ModelMapper();
             return modelMapper.map(dto,clz);
         }
         return null;
    }
}
